[Unit]
Description=Kubernetes Kubelet
Documentation=https://github.com/kubernetes/kubernetes
After=docker.service
Requires=docker.service

[Service]
ExecStart=/usr/local/bin/kubelet \
  --bootstrap-kubeconfig=/etc/kubernetes/bootstrap.kubeconfig \
  --kubeconfig=/etc/kubernetes/kubelet.kubeconfig \
  --config=/etc/kubernetes/kubelet-conf.yml \
  --hostname-override={{ nodename | lower }} \
  --pod-infra-container-image={{ infra_image }} \
  --network-plugin=cni \
  --cni-conf-dir=/etc/cni/net.d \
  --cni-bin-dir=/opt/cni/bin \
  --cert-dir=/etc/kubernetes/pki \
{% if kubelet.logrotate.log is defined and kubelet.logrotate.log %}
  --logtostderr=false \
  --log-dir={{ kubelet.logrotate.logDir }} \
{% endif %}
  --v={{ kubelet.logLevel | default(2)  }}

Restart=always
RestartSec=10s

[Install]
WantedBy=multi-user.target
